
// MCANpLogAnalyserDlg.h : header file
//

#pragma once

typedef enum {StdDevi,MaxMin,MeanOnly,Both} PLOT_TYPE;
class CRawData :
	public vector<vector<double>>
{
public:
	CRawData(void)
	{};
	~CRawData(void)
	{};
	void Add(const double  Time, const double  Mean, const double  Max, const double Min, const double  Dev)
	{
		vector<double> tmp;
		tmp.push_back(Time);
		tmp.push_back(Mean);
		tmp.push_back(Max);
		tmp.push_back(Min);
		tmp.push_back(Dev);
		this->push_back(tmp);
	};
	inline CString ToString(const int nLineIndex)const
	{
		const vector<double>& cCur = (*this)[nLineIndex];
		CString tmp;
		tmp.Format("%3lf %3lf %d %d %3lf %3lf",cCur[0],cCur[1],D2I(cCur[2]),D2I(cCur[3]),cCur[1]-cCur[4],cCur[1]+cCur[4]);
		return tmp;
	};
};

// CMCANpLogAnalyserDlg dialog
class CMCANpLogAnalyserDlg : public CDialog
{
// Construction
public:
	CMCANpLogAnalyserDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_MCANPLOGANALYSER_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
	int Draw(const CRawData& cRawData, const PLOT_TYPE nType, const CString & strName, const CString & strX,const CString & strY,const CString & strOutputPath);
	void CMCANpLogAnalyserDlg::Draw3D(map<int,CRawData> & cData, const CString & strTitle,const CString & strX,const CString & strY,const CString & strZ, const CString & strOutputPath);
public:
	afx_msg void OnBnClickedButtonDrawDistribution();
	afx_msg void OnBnClickedButtonAnalysisRangeQueryResult();
	afx_msg void OnBnClickedButtonAnalysisKnnResult();
};
